package com.trade.okxserver.res;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.trade.okxserver.clr.trade.ProfitConvert;
import lombok.Data;

@Data
public class OrderLog {
    // 买入时间   卖出时间    正常卖出、止损卖出
    //    统计 买入次数 、正常卖出次数、止损卖出次数
    @ExcelProperty("买入时间")
    @ColumnWidth(30)
    private String buyTime;
    @ExcelProperty("买入价格")
    private String buyPrice;
    @ExcelProperty("卖出时间")
    @ColumnWidth(30)
    private String sellTime;
    @ExcelProperty("卖出价格")
    private String sellPrice;
    @ExcelProperty("差价")
    private String diffPrice;
    @ExcelProperty(value = "平仓类型", converter = ProfitConvert.class )
    private boolean profit;

    @Override
    public String toString() {
        return "买入时间：【" + buyTime + "】买入价格 ：【" + buyPrice + "】卖出时间：【" + sellTime + "】卖出价格：【" + sellPrice + "】 平仓类型：【" + (profit ? "止盈" : "止损") + "】差价：【" + diffPrice + "】";
    }
}
